import request from "@/utils/request";

// 获取用户频道数据
export const getChannelsApi = () => {
  return request({
    url: "/v1_0/user/channels",
  });
};
// 获取频道对应数据
export const getArticleListApi = (params) => {
  return request({
    url: "/v1_0/articles",
    method: "get",
    // axios中get方式提交的数据配置在params选项中
    // axios里面查询参数，query数据，是放在params配置项
    // params: params,
    params,
  });
};
// 获取所有频道数据
export const getAllChannelApi = () => {
  return request({
    url: "/v1_0/channels",
  });
};
// 添加用户频道
export const addUserChannelApi = (data) => {
  return request({
    url: "/v1_0/user/channels",
    method: "PATCH",
    // data: data,
    data,
  });
};
// addUserChannelApi({
//   channels:[{ id:xxx,seq:xx }]
// })
// 删除用户指定频道
export const delUserChannelApi = (id) => {
  return request({
    url: "/v1_0/user/channels/" + id,
    method: "delete",
  });
};
